<%-- 
    Document   : fasterfacebook
    Created on : Oct 22, 2009, 6:26:55 PM
    Author     : balbir kaur
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>


<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link href="../include/quiz.css" rel="stylesheet" media="screen"  type="text/css"/>
        <title>CSQUIZ:Faster Publishing</title>
    </head>
    <body>
<script type="text/javascript" src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"></script>
<script type="text/javascript">
   FB.init("d7780c59853dfbf50ca590bc0dc31017","http://ramannanda.blogdns.com:4000/cs1.6quiz/xd_receiver.htm");
</script>
<script type="text/javascript">
function callPublish(msg, attachment, action_link) {
  FB.Bootstrap.requireFeatures(["CanvasUtil","Api","Common","XdComm","Connect","XFBML","Base"],function () {
    FB.ensureInit(function(){FB.Connect.streamPublish('', attachment, action_link);});
  });
}</script>



        <s:include value="/include/header.html"/>
        <div id="allcontent">
            <div id="leftsidebar">
            </div>
            <div id="main">
        
<s:set name="message" value="%{message}" scope="request"/>
        <% StringBuffer message=new StringBuffer();
        
        message.append("I took the Counter Strike 1.6 quiz and scored ");
                           message.append((String)(request.getAttribute("message")));
                           String temp=(String) pageContext.getAttribute("userrank");
                           if(temp!=null &&temp!="NaN"){
                               message.append(" and beat ");
                               message.append(temp);
                               message.append(" of his friends");
                           }
                           
                           String msg=message.toString();


                    %>
    

    <div align="center">
                    <input type="button" onclick="callPublish('',{'name':'CS1.6QUIZ','href':'http://apps.facebook.com/amazingcsquiz','description':'<%=msg+" Take the quiz and find out whether you can beat me"%>','media':[{'type':'image','src':'http://imgcash3.imageshack.us/img224/7821/mave.jpg','href':'http://ramannanda.blogdns.com:4000/cs1.6quiz'}]},[{'text':'Take Quiz','href':'http://ramannanda.blogdns.com:4000/cs1.6quiz'}]);return false;" value="Publish To facebook" />
    </div>
    </div>
        </div>
        <s:include value="/include/footer.jsp"/>
</body>
</html>
